CREATE TABLE [dbo].[GroupPerspective]
(
[GroupPerspectiveKey] [uniqueidentifier] NOT NULL,
[GroupKey] [uniqueidentifier] NOT NULL,
[PerspectiveKey] [uniqueidentifier] NOT NULL,
[IsDefaultFlag] [bit] NOT NULL CONSTRAINT [DF_GroupPerspective_IsDefaultFlag] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GroupPerspective] ADD CONSTRAINT [PK_GroupPerspective] PRIMARY KEY CLUSTERED ([GroupPerspectiveKey]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_GroupPerspective] ON [dbo].[GroupPerspective] ([GroupKey], [PerspectiveKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GroupPerspective] ADD CONSTRAINT [FK_GroupPerspective_GroupMain] FOREIGN KEY ([GroupKey]) REFERENCES [dbo].[GroupMain] ([GroupKey])
GO
ALTER TABLE [dbo].[GroupPerspective] ADD CONSTRAINT [FK_GroupPerspective_Perspective] FOREIGN KEY ([PerspectiveKey]) REFERENCES [dbo].[Perspective] ([PerspectiveKey])
GO